<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<view class="games-box">
			<u-button type="primary" @click="goGames(0)">色块记忆</u-button>
			<u-button type="success" @click="goGames(1)">色块翻转</u-button>
			<u-button type="info" @click="goGames(2)">五子棋</u-button>
			<u-button type="warning"  @click="goGames(3)">颜色混乱</u-button>
			<u-button type="warning"  @click="goGames(4)">方向混乱</u-button>
			<u-button type="warning"  @click="goGames(5)">反弹挑战</u-button>
			<!-- <u-button type="error">危险按钮</u-button> -->
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {

		},
		methods: {
			goGames(index) {

				switch (index) {
					case 0: {
						uni.navigateTo({
							url: "/pages/shiningBlock/rules"
						});
						break;
					}
					case 1: {
						uni.navigateTo({
							url: "/pages/reverseBlock/index"
						});
						break;
					}
					case 2: {
						uni.navigateTo({
							url: "/pages/goBang/index"
						});
						break;
					}
					case 3: {
						uni.navigateTo({
							url: "/pages/colorStroop/index"
						});
						break;
					}
					case 4: {
						uni.navigateTo({
							url: "/pages/directionStroop/index"
						});
						break;
					}
					case 5: {
						uni.navigateTo({
							url: "/pages/bounceBall/index"
						});
						break;
					}
				}
			}

		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	.games-box{
		display: flex;
		justify-content: flex-start;
		flex-wrap: wrap;
	}
	.u-button{
		width: auto;
		margin:20rpx;
	}
</style>